package com.ruoyi.testDeal.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.testDeal.domain.basic.YbBasicinfo;
import com.ruoyi.testDeal.mapper.YbBasicinfoMapper;
import com.ruoyi.testDeal.service.IYbBasicinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 仪器仪通用检测项Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-17
 */
@Service
public class YbBasicinfoServiceImpl implements IYbBasicinfoService
{
    @Autowired
    private YbBasicinfoMapper ybBasicinfoMapper;

    /**
     * 查询仪器仪通用检测项
     * 
     * @param ybBasicId 仪器仪通用检测项主键
     * @return 仪器仪通用检测项
     */
    @Override
    public YbBasicinfo selectYbBasicinfoByYbBasicId(Long ybBasicId)
    {
        return ybBasicinfoMapper.selectYbBasicinfoByYbBasicId(ybBasicId);
    }

    /**
     * 根据报告编号查询
     *
     * @param reportNum
     */
    @Override
    public YbBasicinfo selectYbBasicinfoByReportNum(String reportNum) {
        return ybBasicinfoMapper.selectYbBasicinfoByReportNum(reportNum);
    }

    /**
     * 查询仪器仪通用检测项列表
     * 
     * @param ybBasicinfo 仪器仪通用检测项
     * @return 仪器仪通用检测项
     */
    @Override
    public List<YbBasicinfo> selectYbBasicinfoList(YbBasicinfo ybBasicinfo)
    {
        return ybBasicinfoMapper.selectYbBasicinfoList(ybBasicinfo);
    }

    /**
     * 新增仪器仪通用检测项
     * 
     * @param ybBasicinfo 仪器仪通用检测项
     * @return 结果
     */
    @Override
    public int insertYbBasicinfo(YbBasicinfo ybBasicinfo)
    {
        ybBasicinfo.setCreateTime(DateUtils.getNowDate());
        return ybBasicinfoMapper.insertYbBasicinfo(ybBasicinfo);
    }

    /**
     * 修改仪器仪通用检测项
     * 
     * @param ybBasicinfo 仪器仪通用检测项
     * @return 结果
     */
    @Override
    public int updateYbBasicinfo(YbBasicinfo ybBasicinfo)
    {
        ybBasicinfo.setUpdateTime(DateUtils.getNowDate());
        return ybBasicinfoMapper.updateYbBasicinfo(ybBasicinfo);
    }

    /**
     * 根据报告编号删除
     *
     * @param reportNum
     */
    @Override
    public int deleteYbBasicinfoByReportNum(String reportNum) {
        return ybBasicinfoMapper.deleteYbBasicinfoByReportNum(reportNum);
    }

    /**
     * 批量删除仪器仪通用检测项
     * 
     * @param ybBasicIds 需要删除的仪器仪通用检测项主键
     * @return 结果
     */
    @Override
    public int deleteYbBasicinfoByYbBasicIds(Long[] ybBasicIds)
    {
        return ybBasicinfoMapper.deleteYbBasicinfoByYbBasicIds(ybBasicIds);
    }

    /**
     * 删除仪器仪通用检测项信息
     * 
     * @param ybBasicId 仪器仪通用检测项主键
     * @return 结果
     */
    @Override
    public int deleteYbBasicinfoByYbBasicId(Long ybBasicId)
    {
        return ybBasicinfoMapper.deleteYbBasicinfoByYbBasicId(ybBasicId);
    }
}
